package com.sky.utils;

import org.aspectj.lang.JoinPoint;

public class DataSourceAspect {

	public void before(JoinPoint point)
	{
		Object target = point.getTarget();
		
		DataSource dateSource = target.getClass().getAnnotation(DataSource.class);
		if(dateSource != null)
			DataSourceHolder.setDataSource(dateSource.name());
		else
		{
			DataSourceHolder.setDataSource(DataSource.dataSource);
		}
	}
}
